package com.yidu.controller;

import com.yidu.entity.MyTest;
import com.yidu.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@RestController
public class TestController {
    @Autowired
    private TestService service;
    @RequestMapping("/Hello")
    public Map test(){
        Map<String,Object> map=new HashMap<>();
        List<MyTest> myTests = service.test1();
        map.put("code",0);
        map.put("count",1);
        map.put("data",myTests);
        map.put("msg","");
        return map ;
    }
}
